import request from '../../utils/request';

// service-review 管理相关 API

// 更新服务评价
export const updateServiceReview = (data) => {
    return request({
        url: '/order/service-review/update',
        method: 'put',
        data: data,
    });
};

// 创建服务评价
export const createServiceReview = (data) => {
    return request({
        url: '/order/service-review/create',
        method: 'post',
        data: data,
    });
};

// 根据ID查询服务评价
export const getServiceReviewById = (id) => {
    return request({
        url: `/order/service-review/${id}`,
        method: 'get',
    });
};

// 删除服务评价
export const deleteServiceReview = (id) => {
    return request({
        url: `/order/service-review/${id}`,
        method: 'delete',
    });
};

// 分页查询服务评价
export const getServiceReviewPage = (params) => {
    return request({
        url: '/order/service-review/page',
        method: 'get',
        params: params,
    });
};

// 根据订单和会员查询评价
export const getServiceReviewByOrderAndMember = (orderId, memberId) => {
    return request({
        url: `/order/service-review/order/${orderId}/member/${memberId}`,
        method: 'get',
    });
};

// 查询专家评价统计
export const getReviewStatsByExpertId = (expertId) => {
    return request({
        url: `/order/service-review/expert/${expertId}/stats`,
        method: 'get',
    });
};

